package org.qxj.music.controller;

import org.qxj.music.dao.UserDao;
import org.qxj.music.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 那日苏
 * @description TODO
 * @date 2023-10-20 8:54
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private UserDao userDao;

    @GetMapping("add")
    public User add() {

        User user = new User();

        user.setName("banana");
        user.setEmail("123@163.com");
        user.setPwd("123456");
        user.setSex("男");

        User result = userDao.save(user);
        System.out.println(result);

        return result;
    }
}
